﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BasicDialogPage.aspx.cs" Inherits="CodeCounsel.DialogsDemo.Layouts.CodeCounsel.DialogsDemo.BasicDialogPage" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">

</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <div style="display:none">
        <div id="dialogContent">
            This is the content for the dialog.

            <input type="button" value="Close with data" 
                onclick="SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, 'return value');" />
        </div>
    </div>
    
    <script type="text/javascript">
        function closeDialogCallback(dialogResult, returnValue) {
            alert(dialogResult + " " + returnValue);
        }

        ExecuteOrDelayUntilScriptLoaded(
            function () {
                var options = SP.UI.$create_DialogOptions();
                options.width = 500;
                options.height = 250;
                options.title = "This is the title";
                options.html = document.getElementById('dialogContent');
                options.showClose = true;
                options.dialogReturnValueCallback = closeDialogCallback;
                SP.UI.ModalDialog.showModalDialog(options);
            },
            "SP.UI.Dialog.js");

    </script>

</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Application Page
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My Application Page
</asp:Content>
